fix(astro): Automatically use CSR Show component for prerendered pages#7710
fix(astro): Automatically use CSR Show component for prerendered pages#7710wobsoriano merged 7 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 59a0875 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
📝 WalkthroughWalkthroughAdds a changeset documenting a patch release for 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/astro/src/astro-components/control/Show.astro`:
- Around line 25-28: Guard access to Astro.locals.auth when computing
shouldUseCSR to avoid crashes on prerendered pages: change the logic that sets
shouldUseCSR (currently using isStatic !== undefined ? isStaticOutput(isStatic)
: !Astro.locals.auth) to first detect prerendered context (e.g., via
isPrerenderedPage or by checking Astro.locals existence) and only read
Astro.locals.auth when safe; keep the fallback to isStaticOutput(isStatic) when
isStatic is provided and preserve selecting ShowComponent = shouldUseCSR ?
ShowCSR : ShowSSR. Also add unit/integration tests that verify Show renders with
CSR when runtime auth is present, with SSR when not, and that prerendered pages
do not throw when Astro.locals is undefined.
Description
Port of #7708 but using the
<Show>componentChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
Bug Fixes
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.